﻿<%@ Page Language="C#" MasterPageFile="~/quickLMS.master" AutoEventWireup="true" CodeFile="EditCourse.aspx.cs" Inherits="Admin_EditCourse" Title="Edit Course"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:UpdatePanel ID="update1" runat="server">
    <ContentTemplate>
    <asp:Label ID="lblStatus" runat="server"></asp:Label>
<table>
    <tr>
        <td>Course Name:</td>
        <td><asp:TextBox ID="txtCourseName" runat="server" Columns="50"></asp:TextBox></td>
    </tr>
    
    <tr>
        <td>Description:</td>
        <td><asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Columns="50" Rows="5"></asp:TextBox></td>
    </tr>
    
    <tr>
        <td>Language:</td>
        <td><asp:TextBox ID="txtLanguage" runat="server" Columns="50"></asp:TextBox></td>
    </tr>
    
    <tr>
        <td>Keywords:</td>
        <td><asp:TextBox ID="txtKeywords" runat="server" Columns="50"></asp:TextBox></td>
    </tr>
    
    <tr>
        <td>Coverage:</td>
        <td><asp:TextBox ID="txtCoverage" runat="server" Columns="50"></asp:TextBox></td>
    </tr>
    
    <tr>
        <td>ISBN:</td>
        <td><asp:TextBox ID="txtISBN" runat="server" Columns="50"></asp:TextBox></td>
    </tr>
    
    <tr>
        <td>Life Cycle:</td>
        <td><asp:TextBox ID="txtLifeCycle" runat="server"></asp:TextBox></td>
    </tr>
    

</table>

<asp:Button id="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />

<br />

    </ContentTemplate>
</asp:UpdatePanel>

<asp:UpdateProgress ID="updateProgress" runat="server">
<ProgressTemplate>
    Processing...
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<table>
    <tr>
        <td>Upload IMS Cartridge:</td>
    </tr>
    <tr>
        <td>
            <iframe id="IFrameUpload" name="ifUpload" src="FileUpload.aspx?CourseID=<%= CourseID %>" style="border: 0px; width: 700px; height: 75px;"></iframe><br />
            <input type="button" id="btnUpload" value="Upload Cartridge" onclick="UploadCartridge()" />
        </td>
    </tr>
</table>

<script language="javascript" type="text/javascript">
    var tick = 0;
    function UploadCartridge()
    {
        frames["ifUpload"].document.getElementById("btnLoadZip").click();
        frames["ifUpload"].document.getElementById("hidAccessing").value = "true";
        ShowProgress();
    }
    
    function ShowProgress()
    {
        if (frames["ifUpload"].document.getElementById("hidAccessing").value != "true")
            return;
        if(tick == 0)
            frames["ifUpload"].document.getElementById("lblUploadStatus").innerHTML = "Upload in Progress.";
        else if(tick == 1)
            frames["ifUpload"].document.getElementById("lblUploadStatus").innerHTML = "Upload in Progress..";
        else
            frames["ifUpload"].document.getElementById("lblUploadStatus").innerHTML = "Upload in Progress...";
        tick++;
        if (tick > 2)
            tick = 0;
        if(frames["ifUpload"].document.getElementById("hidAccessing").value == "true")
            setTimeout("ShowProgress()", 1000);
    }
</script>

</asp:Content>

